#include "handle_command.h"

int handle_command(int netfd,char*arr){
    train_t train;
    recv(netfd,&train.type,sizeof(train.type),MSG_WAITALL); 
    recv(netfd,&train.length,sizeof(train.length),MSG_WAITALL);
    if(train.length!=0){
        recv(netfd,train.value,train.length,MSG_WAITALL);
        memcpy(arr,train.value,train.length);
    }
    return train.type;
}

